package drone.basis.util ;

import org.apache.cxf.endpoint.Client ;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory ;

public class WsUtil
{

	public static String inovoke (
			String url ,
			String mothod ,
			Object ... values
	) throws Exception
	{

		JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance ( ) ;

		Client client = dcf.createClient ( url ) ;
		Object [ ] objects = new Object [ 0 ] ;

		objects = client.invoke ( mothod , values ) ;
		String result = objects [ 0 ].toString ( ) ;

		client.close ( ) ;
		client.destroy ( ) ;

		return result ;
	}
}
